package nam.bt.zajnbovv.jewels_new_pro;

import nam.bt.zajnbovv.jewels_new_pro.config.MyConfig;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.ui.activity.BaseGameActivity;
 
import android.content.Context;
import android.os.Bundle;
 
public class Game extends BaseGameActivity {
    public Camera mCamera = null;
    public Context mContext;
    public Engine mEngine = null;
    public Scene mScene = null;
 
    @Override
    protected void onCreate(Bundle pSavedInstanceState) {
        super.onCreate(pSavedInstanceState);
 
        mContext = this;
    }
 
    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
 
    @Override
    public void onLoadComplete() {
        // TODO Auto-generated method stub
 
    }
 
    @Override
    public Engine onLoadEngine() {
        this.mCamera = new Camera(0, 0, MyConfig.SCREENWIDTH,
                MyConfig.SCREENHIEGHT);
        this.mEngine = new Engine(new EngineOptions(true,
                MyConfig.ScreenOrientation_Default, new RatioResolutionPolicy(
                        MyConfig.SCREENWIDTH, MyConfig.SCREENHIEGHT),
                this.mCamera).setNeedsSound(true).setNeedsMusic(true));
 
        // // --------------------------------------------------
        // // Yêu cầu sử lý đa chạm
        // try {
        // if (MultiTouch.isSupported(this)) {
        // this.mEngine.setTouchController(new MultiTouchController());
        // if (MultiTouch.isSupportedDistinct(this)) { // Thiết bị có hỗ
        // // trợ.
        // System.out.println("Support Multitouch");
        // } else {
        // System.out.println("Not Support Multitouch");
        // }
        // } else {
        // System.out.println("Not Support Multitouch");
        // }
        // } catch (Exception e) {
        // System.out.println("Not Support Multitouch");
        // }
        // // --------------------------------------------------
        return mEngine;
    }
 
    @Override
    public void onLoadResources() {
 
    }
 
    @Override
    public Scene onLoadScene() {
        mScene = new Scene();
        mScene.setTouchAreaBindingEnabled(true);
        return this.mScene;
    }
 
}
